package com.example.takeoff.common;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result
{
    private String code;
    private Object data;
    private String message;

    public static Result success()
    {
        return new Result(constants.code_200, null, "");
    }

    public static Result success(Object data)
    {
        return new Result(constants.code_200, data, "");
    }

    public static Result success(Object data, String message)
    {
        return new Result(constants.code_200, data, message);
    }

    public static Result error(String code, String message)
    {
        return new Result(code, null, message);
    }

    public static Result error()
    {
        return new Result(constants.code_300, null, "");
    }

    public static Result success(String message)
    {
        return new Result(constants.code_200, null, message);
    }

    public static Result error(String message)
    {
        return new Result(constants.code_300, null, message);
    }
}
